home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / RTLWIN16.PAK / OLECTL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  43KB  |  1,335 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // olectl.h     OLE Control interfaces
  4. //
  5. //              OLE Version 2.0
  6. //
  7. //              Copyright (c) 1992-1994, Microsoft Corp. All rights reserved.
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10.  
  11. /*
  12.  *      C/C++ Run Time Library - Version 7.0
  13.  *
  14.  *      Copyright (c) 1994, 1996 by Borland International
  15.  *      All Rights Reserved.
  16.  *
  17.  */
  18.  
  19. #ifndef _OLECTL_H_
  20. #define _OLECTL_H_
  21. #define __OLECTL_H
  22.  
  23. #ifndef __MKTYPLIB__
  24.  
  25. // Set packing to 8
  26. #ifdef _WIN32
  27. #ifndef RC_INVOKED
  28. #pragma pack(8)
  29. #endif // not RC_INVOKED
  30. #endif // _WIN32
  31.  
  32. #ifndef INITGUID
  33. #include <olectlid.h>
  34. #endif
  35.  
  36.  
  37. #ifndef _WIN32
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Typedefs for characters and strings in interfaces
  41.  
  42. typedef char OLECHAR;
  43. typedef OLECHAR FAR* LPOLESTR;
  44. typedef const OLECHAR FAR* LPCOLESTR;
  45.  
  46. #endif // not _WIN32
  47.  
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // Typedefs for TEXTMETRIC structures
  51.  
  52. #if defined(_WIN32) && !defined(OLE2ANSI)
  53. typedef TEXTMETRICW TEXTMETRICOLE;
  54. #else
  55. typedef TEXTMETRIC TEXTMETRICOLE;
  56. #endif
  57.  
  58. typedef TEXTMETRICOLE FAR* LPTEXTMETRICOLE;
  59.  
  60.  
  61. /////////////////////////////////////////////////////////////////////////////
  62. // Typedefs for interfaces
  63.  
  64. #ifdef __cplusplus
  65. interface IOleControl;
  66. interface IOleControlSite;
  67. interface ISimpleFrameSite;
  68. interface IErrorLog;
  69. interface IPropertyBag;
  70. interface IPersistPropertyBag;
  71. interface IPersistStreamInit;
  72. interface IPersistMemory;
  73. interface IPropertyNotifySink;
  74. interface IProvideClassInfo;
  75. interface IProvideClassInfo2;
  76. interface IConnectionPointContainer;
  77. interface IEnumConnectionPoints;
  78. interface IConnectionPoint;
  79. interface IEnumConnections;
  80. interface IClassFactory2;
  81. interface ISpecifyPropertyPages;
  82. interface IPerPropertyBrowsing;
  83. interface IPropertyPageSite;
  84. interface IPropertyPage;
  85. interface IPropertyPage2;
  86. interface IFont;
  87. interface IFontDisp;
  88. interface IPicture;
  89. interface IPictureDisp;
  90. #else
  91. typedef interface IOleControl IOleControl;
  92. typedef interface IOleControlSite IOleControlSite;
  93. typedef interface ISimpleFrameSite ISimpleFrameSite;
  94. typedef interface IErrorLog IErrorLog;
  95. typedef interface IPropertyBag IPropertyBag;
  96. typedef interface IPersistPropertyBag IPersistPropertyBag;
  97. typedef interface IPersistStreamInit IPersistStreamInit;
  98. typedef interface IPersistMemory IPersistMemory;
  99. typedef interface IPropertyNotifySink IPropertyNotifySink;
  100. typedef interface IProvideClassInfo IProvideClassInfo;
  101. typedef interface IProvideClassInfo2 IProvideClassInfo2;
  102. typedef interface IConnectionPointContainer IConnectionPointContainer;
  103. typedef interface IEnumConnectionPoints IEnumConnectionPoints;
  104. typedef interface IConnectionPoint IConnectionPoint;
  105. typedef interface IEnumConnections IEnumConnections;
  106. typedef interface IClassFactory2 IClassFactory2;
  107. typedef interface ISpecifyPropertyPages ISpecifyPropertyPages;
  108. typedef interface IPerPropertyBrowsing IPerPropertyBrowsing;
  109. typedef interface IPropertyPageSite IPropertyPageSite;
  110. typedef interface IPropertyPage IPropertyPage;
  111. typedef interface IPropertyPage2 IPropertyPage2;
  112. typedef interface IFont IFont;
  113. typedef interface IFontDisp IFontDisp;
  114. typedef interface IPicture IPicture;
  115. typedef interface IPictureDisp IPictureDisp;
  116. #endif
  117.  
  118. typedef IOleControl FAR* LPOLECONTROL;
  119. typedef IOleControlSite FAR* LPOLECONTROLSITE;
  120. typedef ISimpleFrameSite FAR* LPSIMPLEFRAMESITE;
  121. typedef IErrorLog FAR* LPERRORLOG;
  122. typedef IPropertyBag FAR* LPPROPERTYBAG;
  123. typedef IPersistPropertyBag FAR* LPPERSISTPROPERTYBAG;
  124. typedef IPersistStreamInit FAR* LPPERSISTSTREAMINIT;
  125. typedef IPersistMemory FAR* LPPERSISTMEMORY;
  126. typedef interface IPropertyNotifySink FAR* LPPROPERTYNOTIFYSINK;
  127. typedef IProvideClassInfo FAR* LPPROVIDECLASSINFO;
  128. typedef IProvideClassInfo2 FAR* LPPROVIDECLASSINFO2;
  129. typedef IConnectionPointContainer FAR* LPCONNECTIONPOINTCONTAINER;
  130. typedef IEnumConnectionPoints FAR* LPENUMCONNECTIONPOINTS;
  131. typedef IConnectionPoint FAR* LPCONNECTIONPOINT;
  132. typedef IEnumConnections FAR* LPENUMCONNECTIONS;
  133. typedef IClassFactory2 FAR* LPCLASSFACTORY2;
  134. typedef ISpecifyPropertyPages FAR* LPSPECIFYPROPERTYPAGES;
  135. typedef IPerPropertyBrowsing FAR* LPPERPROPERTYBROWSING;
  136. typedef IPropertyPageSite FAR* LPPROPERTYPAGESITE;
  137. typedef IPropertyPage FAR* LPPROPERTYPAGE;
  138. typedef IPropertyPage2 FAR* LPPROPERTYPAGE2;
  139. typedef IFont FAR* LPFONT;
  140. typedef IFontDisp FAR* LPFONTDISP;
  141. typedef IPicture FAR* LPPICTURE;
  142. typedef IPictureDisp FAR* LPPICTUREDISP;
  143.  
  144.  
  145. /////////////////////////////////////////////////////////////////////////////
  146. // Typedefs for structs
  147.  
  148. typedef struct tagPOINTF FAR* LPPOINTF;
  149. typedef struct tagCONTROLINFO FAR* LPCONTROLINFO;
  150. typedef struct tagCONNECTDATA FAR* LPCONNECTDATA;
  151. typedef struct tagLICINFO FAR* LPLICINFO;
  152. typedef struct tagCAUUID FAR* LPCAUUID;
  153. typedef struct tagCALPOLESTR FAR* LPCALPOLESTR;
  154. typedef struct tagCADWORD FAR* LPCADWORD;
  155. typedef struct tagOCPFIPARAMS FAR* LPOCPFIPARAMS;
  156. typedef struct tagPROPPAGEINFO FAR* LPPROPPAGEINFO;
  157. typedef struct tagFONTDESC FAR* LPFONTDESC;
  158. typedef struct tagPICTDESC FAR* LPPICTDESC;
  159.  
  160.  
  161. /////////////////////////////////////////////////////////////////////////////
  162. // Typedefs for standard scalar types
  163.  
  164. typedef DWORD OLE_COLOR;
  165. typedef long OLE_XPOS_PIXELS;
  166. typedef long OLE_YPOS_PIXELS;
  167. typedef long OLE_XSIZE_PIXELS;
  168. typedef long OLE_YSIZE_PIXELS;
  169. typedef long OLE_XPOS_HIMETRIC;
  170. typedef long OLE_YPOS_HIMETRIC;
  171. typedef long OLE_XSIZE_HIMETRIC;
  172. typedef long OLE_YSIZE_HIMETRIC;
  173. typedef float OLE_XPOS_CONTAINER;
  174. typedef float OLE_YPOS_CONTAINER;
  175. typedef float OLE_XSIZE_CONTAINER;
  176. typedef float OLE_YSIZE_CONTAINER;
  177. typedef enum { triUnchecked = 0, triChecked = 1, triGray = 2 } OLE_TRISTATE;
  178. typedef VARIANT_BOOL OLE_OPTEXCLUSIVE;
  179. typedef VARIANT_BOOL OLE_CANCELBOOL;
  180. typedef VARIANT_BOOL OLE_ENABLEDEFAULTBOOL;
  181. typedef UINT OLE_HANDLE;
  182.  
  183.  
  184. /////////////////////////////////////////////////////////////////////////////
  185. // FACILITY_CONTROL status codes
  186.  
  187. #ifndef FACILITY_CONTROL
  188. #define FACILITY_CONTROL 0xa
  189. #endif
  190.  
  191. #define STD_CTL_SCODE(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_CONTROL, n)
  192. #define CTL_E_ILLEGALFUNCTIONCALL       STD_CTL_SCODE(5)
  193. #define CTL_E_OVERFLOW                  STD_CTL_SCODE(6)
  194. #define CTL_E_OUTOFMEMORY               STD_CTL_SCODE(7)
  195. #define CTL_E_DIVISIONBYZERO            STD_CTL_SCODE(11)
  196. #define CTL_E_OUTOFSTRINGSPACE          STD_CTL_SCODE(14)
  197. #define CTL_E_OUTOFSTACKSPACE           STD_CTL_SCODE(28)
  198. #define CTL_E_BADFILENAMEORNUMBER       STD_CTL_SCODE(52)
  199. #define CTL_E_FILENOTFOUND              STD_CTL_SCODE(53)
  200. #define CTL_E_BADFILEMODE               STD_CTL_SCODE(54)
  201. #define CTL_E_FILEALREADYOPEN           STD_CTL_SCODE(55)
  202. #define CTL_E_DEVICEIOERROR             STD_CTL_SCODE(57)
  203. #define CTL_E_FILEALREADYEXISTS         STD_CTL_SCODE(58)
  204. #define CTL_E_BADRECORDLENGTH           STD_CTL_SCODE(59)
  205. #define CTL_E_DISKFULL                  STD_CTL_SCODE(61)
  206. #define CTL_E_BADRECORDNUMBER           STD_CTL_SCODE(63)
  207. #define CTL_E_BADFILENAME               STD_CTL_SCODE(64)
  208. #define CTL_E_TOOMANYFILES              STD_CTL_SCODE(67)
  209. #define CTL_E_DEVICEUNAVAILABLE         STD_CTL_SCODE(68)
  210. #define CTL_E_PERMISSIONDENIED          STD_CTL_SCODE(70)
  211. #define CTL_E_DISKNOTREADY              STD_CTL_SCODE(71)
  212. #define CTL_E_PATHFILEACCESSERROR       STD_CTL_SCODE(75)
  213. #define CTL_E_PATHNOTFOUND              STD_CTL_SCODE(76)
  214. #define CTL_E_INVALIDPATTERNSTRING      STD_CTL_SCODE(93)
  215. #define CTL_E_INVALIDUSEOFNULL          STD_CTL_SCODE(94)
  216. #define CTL_E_INVALIDFILEFORMAT         STD_CTL_SCODE(321)
  217. #define CTL_E_INVALIDPROPERTYVALUE      STD_CTL_SCODE(380)
  218. #define CTL_E_INVALIDPROPERTYARRAYINDEX STD_CTL_SCODE(381)
  219. #define CTL_E_SETNOTSUPPORTEDATRUNTIME  STD_CTL_SCODE(382)
  220. #define CTL_E_SETNOTSUPPORTED           STD_CTL_SCODE(383)
  221. #define CTL_E_NEEDPROPERTYARRAYINDEX    STD_CTL_SCODE(385)
  222. #define CTL_E_SETNOTPERMITTED           STD_CTL_SCODE(387)
  223. #define CTL_E_GETNOTSUPPORTEDATRUNTIME  STD_CTL_SCODE(393)
  224. #define CTL_E_GETNOTSUPPORTED           STD_CTL_SCODE(394)
  225. #define CTL_E_PROPERTYNOTFOUND          STD_CTL_SCODE(422)
  226. #define CTL_E_INVALIDCLIPBOARDFORMAT    STD_CTL_SCODE(460)
  227. #define CTL_E_INVALIDPICTURE            STD_CTL_SCODE(481)
  228. #define CTL_E_PRINTERERROR              STD_CTL_SCODE(482)
  229. #define CTL_E_CANTSAVEFILETOTEMP        STD_CTL_SCODE(735)
  230. #define CTL_E_SEARCHTEXTNOTFOUND        STD_CTL_SCODE(744)
  231. #define CTL_E_REPLACEMENTSTOOLONG       STD_CTL_SCODE(746)
  232.  
  233. #define CUSTOM_CTL_SCODE(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_CONTROL, n)
  234. #define CTL_E_CUSTOM_FIRST              CUSTOM_CTL_SCODE(600)
  235.  
  236.  
  237. /////////////////////////////////////////////////////////////////////////////
  238. // IClassFactory2 status codes
  239.  
  240. #define CLASS_E_NOTLICENSED         (CLASSFACTORY_E_FIRST+2)
  241. // class is not licensed for use
  242.  
  243.  
  244. /////////////////////////////////////////////////////////////////////////////
  245. // IConnectionPoint status codes
  246.  
  247. #define CONNECT_E_FIRST    MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x0200)
  248. #define CONNECT_E_LAST     MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x020F)
  249. #define CONNECT_S_FIRST    MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200)
  250. #define CONNECT_S_LAST     MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F)
  251.  
  252. #define CONNECT_E_NOCONNECTION      (CONNECT_E_FIRST+0)
  253. // there is no connection for this connection id
  254.  
  255. #define CONNECT_E_ADVISELIMIT       (CONNECT_E_FIRST+1)
  256. // this implementation's limit for advisory connections has been reached
  257.  
  258. #define CONNECT_E_CANNOTCONNECT     (CONNECT_E_FIRST+2)
  259. // connection attempt failed
  260.  
  261. #define CONNECT_E_OVERRIDDEN        (CONNECT_E_FIRST+3)
  262. // must use a derived interface to connect
  263.  
  264.  
  265. /////////////////////////////////////////////////////////////////////////////
  266. // DllRegisterServer/DllUnregisterServer status codes
  267.  
  268. #define SELFREG_E_FIRST    MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x0200)
  269. #define SELFREG_E_LAST     MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x020F)
  270. #define SELFREG_S_FIRST    MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200)
  271. #define SELFREG_S_LAST     MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F)
  272.  
  273. #define SELFREG_E_TYPELIB           (SELFREG_E_FIRST+0)
  274. // failed to register/unregister type library
  275.  
  276. #define SELFREG_E_CLASS             (SELFREG_E_FIRST+1)
  277. // failed to register/unregister class
  278.  
  279.  
  280. /////////////////////////////////////////////////////////////////////////////
  281. // IPerPropertyBrowsing status codes
  282.  
  283. #define PERPROP_E_FIRST    MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x0200)
  284. #define PERPROP_E_LAST     MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x020F)
  285. #define PERPROP_S_FIRST    MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200)
  286. #define PERPROP_S_LAST     MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F)
  287.  
  288. #define PERPROP_E_NOPAGEAVAILABLE   (PERPROP_E_FIRST+0)
  289. // no page available for requested property
  290.  
  291.  
  292. /////////////////////////////////////////////////////////////////////////////
  293. // OLEMISC_ constants
  294.  
  295. #define OLEMISC_INVISIBLEATRUNTIME  0x00000400L
  296. #define OLEMISC_ALWAYSRUN           0x00000800L
  297. #define OLEMISC_ACTSLIKEBUTTON      0x00001000L
  298. #define OLEMISC_ACTSLIKELABEL       0x00002000L
  299. #define OLEMISC_NOUIACTIVATE        0x00004000L
  300. #define OLEMISC_ALIGNABLE           0x00008000L
  301. #define OLEMISC_SIMPLEFRAME         0x00010000L
  302. #define OLEMISC_SETCLIENTSITEFIRST  0x00020000L
  303. #define OLEMISC_IMEMODE                0x00040000L
  304.  
  305.  
  306. /////////////////////////////////////////////////////////////////////////////
  307. // OLEIVERB_ constants
  308.  
  309. #ifndef OLEIVERB_PROPERTIES
  310. #define OLEIVERB_PROPERTIES (-7L)
  311. #endif
  312.  
  313.  
  314. /////////////////////////////////////////////////////////////////////////////
  315. // Variant type (VT_) tags for property sets
  316.  
  317. #define VT_STREAMED_PROPSET 73  //       [P]  Stream contains a property set
  318. #define VT_STORED_PROPSET   74  //       [P]  Storage contains a property set
  319. #define VT_BLOB_PROPSET     75  //       [P]  Blob contains a property set
  320. #define VT_VERBOSE_ENUM        76    //       [P]  Enum value with text string
  321.  
  322.  
  323. /////////////////////////////////////////////////////////////////////////////
  324. // Variant type (VT_) tags that are just aliases for others
  325.  
  326. #define VT_COLOR            VT_I4
  327. #define VT_XPOS_PIXELS      VT_I4
  328. #define VT_YPOS_PIXELS      VT_I4
  329. #define VT_XSIZE_PIXELS     VT_I4
  330. #define VT_YSIZE_PIXELS     VT_I4
  331. #define VT_XPOS_HIMETRIC    VT_I4
  332. #define VT_YPOS_HIMETRIC    VT_I4
  333. #define VT_XSIZE_HIMETRIC   VT_I4
  334. #define VT_YSIZE_HIMETRIC   VT_I4
  335. #define VT_TRISTATE         VT_I2
  336. #define VT_OPTEXCLUSIVE     VT_BOOL
  337. #define VT_FONT             VT_DISPATCH
  338. #define VT_PICTURE          VT_DISPATCH
  339.  
  340. #ifdef _WIN32
  341. #define VT_HANDLE           VT_I4
  342. #else
  343. #define VT_HANDLE           VT_I2
  344. #endif
  345.  
  346.  
  347. /////////////////////////////////////////////////////////////////////////////
  348. // Reflected Window Message IDs
  349.  
  350. #define OCM__BASE           (WM_USER+0x1c00)
  351. #define OCM_COMMAND         (OCM__BASE + WM_COMMAND)
  352.  
  353. #ifdef _WIN32
  354. #define OCM_CTLCOLORBTN     (OCM__BASE + WM_CTLCOLORBTN)
  355. #define OCM_CTLCOLOREDIT    (OCM__BASE + WM_CTLCOLOREDIT)
  356. #define OCM_CTLCOLORDLG     (OCM__BASE + WM_CTLCOLORDLG)
  357. #define OCM_CTLCOLORLISTBOX (OCM__BASE + WM_CTLCOLORLISTBOX)
  358. #define OCM_CTLCOLORMSGBOX  (OCM__BASE + WM_CTLCOLORMSGBOX)
  359. #define OCM_CTLCOLORSCROLLBAR   (OCM__BASE + WM_CTLCOLORSCROLLBAR)
  360. #define OCM_CTLCOLORSTATIC  (OCM__BASE + WM_CTLCOLORSTATIC)
  361. #else
  362. #define OCM_CTLCOLOR        (OCM__BASE + WM_CTLCOLOR)
  363. #endif
  364.  
  365. #define OCM_DRAWITEM        (OCM__BASE + WM_DRAWITEM)
  366. #define OCM_MEASUREITEM     (OCM__BASE + WM_MEASUREITEM)
  367. #define OCM_DELETEITEM      (OCM__BASE + WM_DELETEITEM)
  368. #define OCM_VKEYTOITEM      (OCM__BASE + WM_VKEYTOITEM)
  369. #define OCM_CHARTOITEM      (OCM__BASE + WM_CHARTOITEM)
  370. #define OCM_COMPAREITEM     (OCM__BASE + WM_COMPAREITEM)
  371. #define OCM_HSCROLL         (OCM__BASE + WM_HSCROLL)
  372. #define OCM_VSCROLL         (OCM__BASE + WM_VSCROLL)
  373. #define OCM_PARENTNOTIFY    (OCM__BASE + WM_PARENTNOTIFY)
  374.  
  375. #if (WINVER >= 0x0400)
  376. #define OCM_NOTIFY            (OCM__BASE + WM_NOTIFY)
  377. #endif
  378.  
  379.  
  380. /////////////////////////////////////////////////////////////////////////////
  381. // Self-registration APIs (to be implemented by server DLL)
  382.  
  383. STDAPI DllRegisterServer(void);
  384. STDAPI DllUnregisterServer(void);
  385.  
  386.  
  387. /////////////////////////////////////////////////////////////////////////////
  388. // Property frame APIs
  389.  
  390. STDAPI OleCreatePropertyFrame(HWND hwndOwner, UINT x, UINT y,
  391.     LPCOLESTR lpszCaption, ULONG cObjects, LPUNKNOWN FAR* ppUnk, ULONG cPages,
  392.     LPCLSID pPageClsID, LCID lcid, DWORD dwReserved, LPVOID pvReserved);
  393.  
  394. STDAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams);
  395.  
  396.  
  397. /////////////////////////////////////////////////////////////////////////////
  398. // Standard type APIs
  399.  
  400. STDAPI OleTranslateColor(OLE_COLOR clr, HPALETTE hpal, COLORREF* lpcolorref);
  401.  
  402. STDAPI OleCreateFontIndirect(LPFONTDESC lpFontDesc, REFIID riid,
  403.     LPVOID FAR* lplpvObj);
  404.  
  405. STDAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid, BOOL fOwn,
  406.     LPVOID FAR* lplpvObj);
  407.  
  408. STDAPI OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
  409.     REFIID riid, LPVOID FAR* lplpvObj);
  410.  
  411. STDAPI_(HCURSOR) OleIconToCursor(HINSTANCE hinstExe, HICON hIcon);
  412.  
  413.  
  414. /////////////////////////////////////////////////////////////////////////////
  415. // POINTF structure
  416.  
  417. typedef struct tagPOINTF
  418. {
  419.     float x;
  420.     float y;
  421.  
  422. } POINTF;
  423.  
  424.  
  425. /////////////////////////////////////////////////////////////////////////////
  426. // CONTROLINFO structure
  427.  
  428. typedef struct tagCONTROLINFO
  429. {
  430.     ULONG cb;       // Structure size
  431.     HACCEL hAccel;  // Control mnemonics
  432.     USHORT cAccel;  // Number of entries in mnemonics table
  433.     DWORD dwFlags;  // Flags chosen from below
  434.  
  435. } CONTROLINFO;
  436.  
  437. #define CTRLINFO_EATS_RETURN    1   // Control doesn't send Return to container
  438. #define CTRLINFO_EATS_ESCAPE    2   // Control doesn't send Escape to container
  439.  
  440.  
  441. /////////////////////////////////////////////////////////////////////////////
  442. // IOleControl interface
  443.  
  444. #undef  INTERFACE
  445. #define INTERFACE IOleControl
  446.  
  447. DECLARE_INTERFACE_(IOleControl, IUnknown)
  448. {
  449.     // IUnknown methods
  450.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  451.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  452.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  453.  
  454.     // IOleControl methods
  455.     STDMETHOD(GetControlInfo)(THIS_ LPCONTROLINFO pCI) PURE;
  456.     STDMETHOD(OnMnemonic)(THIS_ LPMSG pMsg) PURE;
  457.     STDMETHOD(OnAmbientPropertyChange)(THIS_ DISPID dispid) PURE;
  458.     STDMETHOD(FreezeEvents)(THIS_ BOOL bFreeze) PURE;
  459. };
  460.  
  461.  
  462. /////////////////////////////////////////////////////////////////////////////
  463. // IOleControlSite interface
  464.  
  465. #undef  INTERFACE
  466. #define INTERFACE IOleControlSite
  467.  
  468. DECLARE_INTERFACE_(IOleControlSite, IUnknown)
  469. {
  470.     // IUnknown methods
  471.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  472.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  473.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  474.  
  475.     // IOleControlSite methods
  476.     STDMETHOD(OnControlInfoChanged)(THIS) PURE;
  477.     STDMETHOD(LockInPlaceActive)(THIS_ BOOL fLock) PURE;
  478.     STDMETHOD(GetExtendedControl)(THIS_ LPDISPATCH FAR* ppDisp) PURE;
  479.     STDMETHOD(TransformCoords)(THIS_ POINTL FAR* lpptlHimetric,
  480.         POINTF FAR* lpptfContainer, DWORD flags) PURE;
  481.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg, DWORD grfModifiers)
  482.         PURE;
  483.     STDMETHOD(OnFocus)(THIS_ BOOL fGotFocus) PURE;
  484.     STDMETHOD(ShowPropertyFrame)(THIS) PURE;
  485. };
  486.  
  487. #define XFORMCOORDS_POSITION            0x1
  488. #define XFORMCOORDS_SIZE                0x2
  489. #define XFORMCOORDS_HIMETRICTOCONTAINER 0x4
  490. #define XFORMCOORDS_CONTAINERTOHIMETRIC 0x8
  491.  
  492.  
  493. /////////////////////////////////////////////////////////////////////////////
  494. // ISimpleFrameSite interface
  495.  
  496. #undef  INTERFACE
  497. #define INTERFACE ISimpleFrameSite
  498.  
  499. DECLARE_INTERFACE_(ISimpleFrameSite, IUnknown)
  500. {
  501.     // IUnknown methods
  502.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  503.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  504.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  505.  
  506.     // ISimpleFrameSite methods
  507.     STDMETHOD(PreMessageFilter)(THIS_ HWND hwnd, UINT msg, WPARAM wp,
  508.         LPARAM lp, LRESULT FAR* lplResult, DWORD FAR * lpdwCookie) PURE;
  509.     STDMETHOD(PostMessageFilter)(THIS_ HWND hwnd, UINT msg, WPARAM wp,
  510.         LPARAM lp, LRESULT FAR* lplResult, DWORD dwCookie) PURE;
  511. };
  512.  
  513.  
  514. /////////////////////////////////////////////////////////////////////////////
  515. // IErrorLog interface
  516.  
  517. #undef  INTERFACE
  518. #define INTERFACE IErrorLog
  519.  
  520. DECLARE_INTERFACE_(IErrorLog, IUnknown)
  521. {
  522.     // IUnknown methods
  523.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  524.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  525.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  526.  
  527.     // IErrorLog methods
  528.     STDMETHOD(AddError)(THIS_ LPCOLESTR pszPropName, LPEXCEPINFO pExcepInfo) PURE;
  529. };
  530.  
  531.  
  532. /////////////////////////////////////////////////////////////////////////////
  533. // IPropertyBag interface
  534.  
  535. #undef  INTERFACE
  536. #define INTERFACE IPropertyBag
  537.  
  538. DECLARE_INTERFACE_(IPropertyBag, IUnknown)
  539. {
  540.     // IUnknown methods
  541.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  542.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  543.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  544.  
  545.     // IPropertyBag methods
  546.     STDMETHOD(Read)(THIS_ LPCOLESTR pszPropName, LPVARIANT pVar,
  547.         LPERRORLOG pErrorLog) PURE;
  548.     STDMETHOD(Write)(THIS_ LPCOLESTR pszPropName, LPVARIANT pVar) PURE;
  549. };
  550.  
  551.  
  552. /////////////////////////////////////////////////////////////////////////////
  553. // IPersistPropertyBag interface
  554.  
  555. #undef  INTERFACE
  556. #define INTERFACE IPersistPropertyBag
  557.  
  558. DECLARE_INTERFACE_(IPersistPropertyBag, IPersist)
  559. {
  560.     // IUnknown methods
  561.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  562.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  563.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  564.  
  565.     // IPersist methods
  566.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  567.  
  568.     // IPersistPropertyBag methods
  569.     STDMETHOD(InitNew)(THIS) PURE;
  570.     STDMETHOD(Load)(THIS_ LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog) PURE;
  571.     STDMETHOD(Save)(THIS_ LPPROPERTYBAG pPropBag, BOOL fClearDirty,
  572.         BOOL fSaveAllProperties) PURE;
  573. };
  574.  
  575.  
  576. /////////////////////////////////////////////////////////////////////////////
  577. // IPersistStreamInit interface
  578.  
  579. #undef  INTERFACE
  580. #define INTERFACE IPersistStreamInit
  581.  
  582. DECLARE_INTERFACE_(IPersistStreamInit, IPersist)
  583. {
  584.     // IUnknown methods
  585.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  586.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  587.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  588.  
  589.     // IPersist methods
  590.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  591.  
  592.     // IPersistStreamInit methods
  593.     STDMETHOD(IsDirty)(THIS) PURE;
  594.     STDMETHOD(Load)(THIS_ LPSTREAM pStm) PURE;
  595.     STDMETHOD(Save)(THIS_ LPSTREAM pStm, BOOL fClearDirty) PURE;
  596.     STDMETHOD(GetSizeMax)(THIS_ ULARGE_INTEGER FAR* pcbSize) PURE;
  597.     STDMETHOD(InitNew)(THIS) PURE;
  598. };
  599.  
  600.  
  601. /////////////////////////////////////////////////////////////////////////////
  602. // IPersistMemory interface
  603.  
  604. #undef  INTERFACE
  605. #define INTERFACE IPersistMemory
  606.  
  607. DECLARE_INTERFACE_(IPersistMemory, IPersist)
  608. {
  609.     // IUnknown methods
  610.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  611.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  612.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  613.  
  614.     // IPersist methods
  615.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  616.  
  617.     // IPersistMemory methods
  618.     STDMETHOD(IsDirty)(THIS) PURE;
  619.     STDMETHOD(Load)(THIS_ LPVOID lpStream, ULONG cbSize) PURE;
  620.     STDMETHOD(Save)(THIS_ LPVOID lpStream, BOOL fClearDirty, ULONG cbSize) PURE;
  621.     STDMETHOD(GetSizeMax)(THIS_ ULONG* pcbSize) PURE;
  622.     STDMETHOD(InitNew)(THIS) PURE;
  623. };
  624.  
  625.  
  626. /////////////////////////////////////////////////////////////////////////////
  627. // IPropertyNotifySink interface
  628.  
  629. #undef  INTERFACE
  630. #define INTERFACE IPropertyNotifySink
  631.  
  632. DECLARE_INTERFACE_(IPropertyNotifySink, IUnknown)
  633. {
  634.     // IUnknown methods
  635.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  636.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  637.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  638.  
  639.     // IPropertyNotifySink methods
  640.     STDMETHOD(OnChanged)(THIS_ DISPID dispid) PURE;
  641.     STDMETHOD(OnRequestEdit)(THIS_ DISPID dispid) PURE;
  642. };
  643.  
  644.  
  645. /////////////////////////////////////////////////////////////////////////////
  646. // IProvideClassInfo interface
  647.  
  648. #undef  INTERFACE
  649. #define INTERFACE IProvideClassInfo
  650.  
  651. DECLARE_INTERFACE_(IProvideClassInfo, IUnknown)
  652. {
  653.     // IUnknown methods
  654.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  655.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  656.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  657.  
  658.     // IProvideClassInfo methods
  659.     STDMETHOD(GetClassInfo)(THIS_ LPTYPEINFO FAR* ppTI) PURE;
  660. };
  661.  
  662.  
  663. /////////////////////////////////////////////////////////////////////////////
  664. // IProvideClassInfo2 interface
  665.  
  666. #undef  INTERFACE
  667. #define INTERFACE IProvideClassInfo2
  668.  
  669. DECLARE_INTERFACE_(IProvideClassInfo2, IProvideClassInfo)
  670. {
  671.     // IUnknown methods
  672.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  673.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  674.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  675.  
  676.     // IProvideClassInfo methods
  677.     STDMETHOD(GetClassInfo)(THIS_ LPTYPEINFO FAR* ppTI) PURE;
  678.  
  679.     // IProvideClassInfo2 methods
  680.     STDMETHOD(GetGUID)(THIS_ DWORD dwGuidKind, GUID FAR* pGUID) PURE;
  681. };
  682.  
  683. #define GUIDKIND_DEFAULT_SOURCE_DISP_IID    1
  684.  
  685. /////////////////////////////////////////////////////////////////////////////
  686. // IConnectionPointContainer interface
  687.  
  688. #undef  INTERFACE
  689. #define INTERFACE IConnectionPointContainer
  690.  
  691. DECLARE_INTERFACE_(IConnectionPointContainer, IUnknown)
  692. {
  693.     // IUnknown methods
  694.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  695.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  696.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  697.  
  698.     // IConnectionPointContainer methods
  699.     STDMETHOD(EnumConnectionPoints)(THIS_ LPENUMCONNECTIONPOINTS FAR* ppEnum)
  700.         PURE;
  701.     STDMETHOD(FindConnectionPoint)(THIS_ REFIID iid,
  702.         LPCONNECTIONPOINT FAR* ppCP) PURE;
  703. };
  704.  
  705.  
  706. /////////////////////////////////////////////////////////////////////////////
  707. // IEnumConnectionPoint interface
  708.  
  709. #undef  INTERFACE
  710. #define INTERFACE IEnumConnectionPoints
  711.  
  712. DECLARE_INTERFACE_(IEnumConnectionPoints, IUnknown)
  713. {
  714.     // IUnknown methods
  715.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  716.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  717.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  718.  
  719.     // IEnumConnectionPoints methods
  720.     STDMETHOD(Next)(THIS_ ULONG cConnections, LPCONNECTIONPOINT FAR* rgpcn,
  721.         ULONG FAR* lpcFetched) PURE;
  722.     STDMETHOD(Skip)(THIS_ ULONG cConnections) PURE;
  723.     STDMETHOD(Reset)(THIS) PURE;
  724.     STDMETHOD(Clone)(THIS_ LPENUMCONNECTIONPOINTS FAR* ppEnum) PURE;
  725. };
  726.  
  727.  
  728. /////////////////////////////////////////////////////////////////////////////
  729. // IConnectionPoint interface
  730.  
  731. #undef  INTERFACE
  732. #define INTERFACE IConnectionPoint
  733.  
  734. DECLARE_INTERFACE_(IConnectionPoint, IUnknown)
  735. {
  736.     // IUnknown methods
  737.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  738.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  739.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  740.  
  741.     // IConnectionPoint methods
  742.     STDMETHOD(GetConnectionInterface)(THIS_ IID FAR* pIID) PURE;
  743.     STDMETHOD(GetConnectionPointContainer)(THIS_
  744.         IConnectionPointContainer FAR* FAR* ppCPC) PURE;
  745.     STDMETHOD(Advise)(THIS_ LPUNKNOWN pUnkSink, DWORD FAR* pdwCookie) PURE;
  746.     STDMETHOD(Unadvise)(THIS_ DWORD dwCookie) PURE;
  747.     STDMETHOD(EnumConnections)(THIS_ LPENUMCONNECTIONS FAR* ppEnum) PURE;
  748. };
  749.  
  750.  
  751. /////////////////////////////////////////////////////////////////////////////
  752. // CONNECTDATA structure
  753.  
  754. typedef struct tagCONNECTDATA
  755. {
  756.     LPUNKNOWN pUnk;
  757.     DWORD dwCookie;
  758.  
  759. } CONNECTDATA;
  760.  
  761.  
  762. /////////////////////////////////////////////////////////////////////////////
  763. // IEnumConnections interface
  764.  
  765. #undef  INTERFACE
  766. #define INTERFACE IEnumConnections
  767.  
  768. DECLARE_INTERFACE_(IEnumConnections, IUnknown)
  769. {
  770.     // IUnknown methods
  771.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  772.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  773.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  774.  
  775.     // IEnumConnections methods
  776.     STDMETHOD(Next)(THIS_ ULONG cConnections, LPCONNECTDATA rgcd,
  777.         ULONG FAR* lpcFetched) PURE;
  778.     STDMETHOD(Skip)(THIS_ ULONG cConnections) PURE;
  779.     STDMETHOD(Reset)(THIS) PURE;
  780.     STDMETHOD(Clone)(THIS_ LPENUMCONNECTIONS FAR* ppecn) PURE;
  781. };
  782.  
  783.  
  784. /////////////////////////////////////////////////////////////////////////////
  785. // LICINFO structure
  786.  
  787. typedef struct tagLICINFO
  788. {
  789.     long cbLicInfo;
  790.     BOOL fRuntimeKeyAvail;
  791.     BOOL fLicVerified;
  792.  
  793. } LICINFO;
  794.  
  795.  
  796. /////////////////////////////////////////////////////////////////////////////
  797. // IClassFactory2 interface
  798.  
  799. #undef  INTERFACE
  800. #define INTERFACE IClassFactory2
  801.  
  802. DECLARE_INTERFACE_(IClassFactory2, IClassFactory)
  803. {
  804.     // IUnknown methods
  805.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  806.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  807.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  808.  
  809.     // IClassFactory methods
  810.     STDMETHOD(CreateInstance)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid,
  811.         LPVOID FAR* ppvObject) PURE;
  812.     STDMETHOD(LockServer)(THIS_ BOOL fLock) PURE;
  813.  
  814.     //  IClassFactory2 methods
  815.     STDMETHOD(GetLicInfo)(THIS_ LPLICINFO pLicInfo) PURE;
  816.     STDMETHOD(RequestLicKey)(THIS_ DWORD dwResrved, BSTR FAR* pbstrKey) PURE;
  817.     STDMETHOD(CreateInstanceLic)(THIS_ LPUNKNOWN pUnkOuter,
  818.         LPUNKNOWN pUnkReserved, REFIID riid, BSTR bstrKey,
  819.         LPVOID FAR* ppvObject) PURE;
  820. };
  821.  
  822.  
  823. /////////////////////////////////////////////////////////////////////////////
  824. //  CAUUID structure - a counted array of UUIDs
  825.  
  826. #ifndef _tagCAUUID_DEFINED
  827. #define _tagCAUUID_DEFINED
  828. #define _CAUUID_DEFINED
  829.  
  830. typedef struct tagCAUUID
  831. {
  832.     ULONG cElems;
  833.     GUID FAR* pElems;
  834.  
  835. } CAUUID;
  836.  
  837. #endif
  838.  
  839.  
  840. /////////////////////////////////////////////////////////////////////////////
  841. //  CALPOLESTR structure - a counted array of LPOLESTRs
  842.  
  843. #ifndef _tagCALPOLESTR_DEFINED
  844. #define _tagCALPOLESTR_DEFINED
  845. #define _CALPOLESTR_DEFINED
  846.  
  847. typedef struct tagCALPOLESTR
  848. {
  849.     ULONG cElems;
  850.     LPOLESTR FAR* pElems;
  851.  
  852. } CALPOLESTR;
  853.  
  854. #endif
  855.  
  856.  
  857. /////////////////////////////////////////////////////////////////////////////
  858. //  CAUUID structure - a counted array of DWORDs
  859.  
  860. #ifndef _tagCADWORD_DEFINED
  861. #define _tagCADWORD_DEFINED
  862. #define _CADWORD_DEFINED
  863.  
  864. typedef struct tagCADWORD
  865. {
  866.     ULONG cElems;
  867.     DWORD FAR* pElems;
  868.  
  869. } CADWORD;
  870.  
  871. #endif
  872.  
  873.  
  874. /////////////////////////////////////////////////////////////////////////////
  875. // OCPFIPARAMS structure - parameters for OleCreatePropertyFrameIndirect
  876.  
  877. typedef struct tagOCPFIPARAMS
  878. {
  879.     ULONG cbStructSize;
  880.     HWND hWndOwner;
  881.     int x;
  882.     int y;
  883.     LPCOLESTR lpszCaption;
  884.     ULONG cObjects;
  885.     LPUNKNOWN FAR* lplpUnk;
  886.     ULONG cPages;
  887.     CLSID FAR* lpPages;
  888.     LCID lcid;
  889.     DISPID dispidInitialProperty;
  890.  
  891. } OCPFIPARAMS;
  892.  
  893.  
  894. /////////////////////////////////////////////////////////////////////////////
  895. // PROPPAGEINFO structure - information about a property page
  896.  
  897. typedef struct tagPROPPAGEINFO
  898. {
  899.     size_t cb;
  900.     LPOLESTR pszTitle;
  901.     SIZE size;
  902.     LPOLESTR pszDocString;
  903.     LPOLESTR pszHelpFile;
  904.     DWORD dwHelpContext;
  905.  
  906. } PROPPAGEINFO;
  907.  
  908.  
  909. /////////////////////////////////////////////////////////////////////////////
  910. // ISpecifyPropertyPages interface
  911.  
  912. #undef  INTERFACE
  913. #define INTERFACE ISpecifyPropertyPages
  914.  
  915. DECLARE_INTERFACE_(ISpecifyPropertyPages, IUnknown)
  916. {
  917.     // IUnknown methods
  918.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  919.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  920.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  921.  
  922.     // ISpecifyPropertyPages interface
  923.     STDMETHOD(GetPages)(THIS_ CAUUID FAR* pPages) PURE;
  924. };
  925.  
  926.  
  927. /////////////////////////////////////////////////////////////////////////////
  928. // IPerPropertyBrowsing interface
  929.  
  930. #undef  INTERFACE
  931. #define INTERFACE IPerPropertyBrowsing
  932.  
  933. DECLARE_INTERFACE_(IPerPropertyBrowsing, IUnknown)
  934. {
  935.     // IUnknown methods
  936.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  937.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  938.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  939.  
  940.     // IPerPropertyBrowsing interface
  941.     STDMETHOD(GetDisplayString)(THIS_ DISPID dispid, BSTR FAR* lpbstr) PURE;
  942.     STDMETHOD(MapPropertyToPage)(THIS_ DISPID dispid, LPCLSID lpclsid) PURE;
  943.     STDMETHOD(GetPredefinedStrings)(THIS_ DISPID dispid,
  944.         CALPOLESTR FAR* lpcaStringsOut, CADWORD FAR* lpcaCookiesOut) PURE;
  945.     STDMETHOD(GetPredefinedValue)(THIS_ DISPID dispid, DWORD dwCookie,
  946.         VARIANT FAR* lpvarOut) PURE;
  947. };
  948.  
  949.  
  950. /////////////////////////////////////////////////////////////////////////////
  951. // IPropertyPageSite interface
  952.  
  953. #undef  INTERFACE
  954. #define INTERFACE IPropertyPageSite
  955.  
  956. DECLARE_INTERFACE_(IPropertyPageSite, IUnknown)
  957. {
  958.     // IUnknown methods
  959.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  960.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  961.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  962.  
  963.     // IPropertyPageSite methods
  964.     STDMETHOD(OnStatusChange)(THIS_ DWORD flags) PURE;
  965.     STDMETHOD(GetLocaleID)(THIS_ LCID FAR* pLocaleID) PURE;
  966.     STDMETHOD(GetPageContainer)(THIS_ LPUNKNOWN FAR* ppUnk) PURE;
  967.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg) PURE;
  968. };
  969.  
  970. #define PROPPAGESTATUS_DIRTY    0x1 // Values in page have changed
  971. #define PROPPAGESTATUS_VALIDATE 0x2 // Appropriate time to validate/apply
  972.  
  973.  
  974. /////////////////////////////////////////////////////////////////////////////
  975. // IPropertyPage interface
  976.  
  977. #undef  INTERFACE
  978. #define INTERFACE IPropertyPage
  979.  
  980. DECLARE_INTERFACE_(IPropertyPage, IUnknown)
  981. {
  982.     // IUnknown methods
  983.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  984.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  985.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  986.  
  987.     // IPropertyPage methods
  988.     STDMETHOD(SetPageSite)(THIS_ LPPROPERTYPAGESITE pPageSite) PURE;
  989.     STDMETHOD(Activate)(THIS_ HWND hwndParent, LPCRECT lprc, BOOL bModal) PURE;
  990.     STDMETHOD(Deactivate)(THIS) PURE;
  991.     STDMETHOD(GetPageInfo)(THIS_ LPPROPPAGEINFO pPageInfo) PURE;
  992.     STDMETHOD(SetObjects)(THIS_ ULONG cObjects, LPUNKNOWN FAR* ppunk) PURE;
  993.     STDMETHOD(Show)(THIS_ UINT nCmdShow) PURE;
  994.     STDMETHOD(Move)(THIS_ LPCRECT prect) PURE;
  995.     STDMETHOD(IsPageDirty)(THIS) PURE;
  996.     STDMETHOD(Apply)(THIS) PURE;
  997.     STDMETHOD(Help)(THIS_ LPCOLESTR lpszHelpDir) PURE;
  998.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg) PURE;
  999. };
  1000.  
  1001.  
  1002. /////////////////////////////////////////////////////////////////////////////
  1003. // IPropertyPage2 interface
  1004.  
  1005. #undef  INTERFACE
  1006. #define INTERFACE IPropertyPage2
  1007.  
  1008. DECLARE_INTERFACE_(IPropertyPage2, IPropertyPage)
  1009. {
  1010.     // IUnknown methods
  1011.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1012.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1013.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  1014.  
  1015.     // IPropertyPage methods
  1016.     STDMETHOD(SetPageSite)(THIS_ LPPROPERTYPAGESITE pPageSite) PURE;
  1017.     STDMETHOD(Activate)(THIS_ HWND hwndParent, LPCRECT lprc, BOOL bModal) PURE;
  1018.     STDMETHOD(Deactivate)(THIS) PURE;
  1019.     STDMETHOD(GetPageInfo)(THIS_ LPPROPPAGEINFO pPageInfo) PURE;
  1020.     STDMETHOD(SetObjects)(THIS_ ULONG cObjects, LPUNKNOWN FAR* ppunk) PURE;
  1021.     STDMETHOD(Show)(THIS_ UINT nCmdShow) PURE;
  1022.     STDMETHOD(Move)(THIS_ LPCRECT prect) PURE;
  1023.     STDMETHOD(IsPageDirty)(THIS) PURE;
  1024.     STDMETHOD(Apply)(THIS) PURE;
  1025.     STDMETHOD(Help)(THIS_ LPCOLESTR lpszHelpDir) PURE;
  1026.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg) PURE;
  1027.  
  1028.     // IPropertyPage2 methods
  1029.     STDMETHOD(EditProperty)(THIS_ DISPID dispid) PURE;
  1030. };
  1031.  
  1032.  
  1033. /////////////////////////////////////////////////////////////////////////////
  1034. // IFont interface
  1035.  
  1036. #undef  INTERFACE
  1037. #define INTERFACE IFont
  1038.  
  1039. DECLARE_INTERFACE_(IFont, IUnknown)
  1040. {
  1041.     // IUnknown methods
  1042.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1043.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1044.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1045.  
  1046.     // IFont methods
  1047.     STDMETHOD(get_Name)(THIS_ BSTR FAR* pname) PURE;
  1048.     STDMETHOD(put_Name)(THIS_ BSTR name) PURE;
  1049.     STDMETHOD(get_Size)(THIS_ CY FAR* psize) PURE;
  1050.     STDMETHOD(put_Size)(THIS_ CY size) PURE;
  1051.     STDMETHOD(get_Bold)(THIS_ BOOL FAR* pbold) PURE;
  1052.     STDMETHOD(put_Bold)(THIS_ BOOL bold) PURE;
  1053.     STDMETHOD(get_Italic)(THIS_ BOOL FAR* pitalic) PURE;
  1054.     STDMETHOD(put_Italic)(THIS_ BOOL italic) PURE;
  1055.     STDMETHOD(get_Underline)(THIS_ BOOL FAR* punderline) PURE;
  1056.     STDMETHOD(put_Underline)(THIS_ BOOL underline) PURE;
  1057.     STDMETHOD(get_Strikethrough)(THIS_ BOOL FAR* pstrikethrough) PURE;
  1058.     STDMETHOD(put_Strikethrough)(THIS_ BOOL strikethrough) PURE;
  1059.     STDMETHOD(get_Weight)(THIS_ short FAR* pweight) PURE;
  1060.     STDMETHOD(put_Weight)(THIS_ short weight) PURE;
  1061.     STDMETHOD(get_Charset)(THIS_ short FAR* pcharset) PURE;
  1062.     STDMETHOD(put_Charset)(THIS_ short charset) PURE;
  1063.     STDMETHOD(get_hFont)(THIS_ HFONT FAR* phfont) PURE;
  1064.     STDMETHOD(Clone)(THIS_ IFont FAR* FAR* lplpfont) PURE;
  1065.     STDMETHOD(IsEqual)(THIS_ IFont FAR * lpFontOther) PURE;
  1066.     STDMETHOD(SetRatio)(THIS_ long cyLogical, long cyHimetric) PURE;
  1067.     STDMETHOD(QueryTextMetrics)(THIS_ LPTEXTMETRICOLE lptm) PURE;
  1068.     STDMETHOD(AddRefHfont)(THIS_ HFONT hfont) PURE;
  1069.     STDMETHOD(ReleaseHfont)(THIS_ HFONT hfont) PURE;
  1070.     STDMETHOD(SetHdc)(THIS_ HDC hdc) PURE;
  1071. };
  1072.  
  1073.  
  1074. /////////////////////////////////////////////////////////////////////////////
  1075. // IFontDisp interface
  1076.  
  1077. #undef  INTERFACE
  1078. #define INTERFACE IFontDisp
  1079.  
  1080. DECLARE_INTERFACE_(IFontDisp, IDispatch)
  1081. {
  1082.     // IUnknown methods
  1083.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1084.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1085.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1086.  
  1087.     // IDispatch methods
  1088.     STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  1089.     STDMETHOD(GetTypeInfo)(THIS_ UINT itinfo, LCID lcid,
  1090.         ITypeInfo FAR* FAR* pptinfo) PURE;
  1091.     STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, LPOLESTR FAR* rgszNames,
  1092.         UINT cNames, LCID lcid, DISPID FAR* rgdispid) PURE;
  1093.     STDMETHOD(Invoke)(THIS_ DISPID dispidMember, REFIID riid, LCID lcid,
  1094.         WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult,
  1095.         EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr) PURE;
  1096. };
  1097.  
  1098.  
  1099. /////////////////////////////////////////////////////////////////////////////
  1100. // FONTDESC structure
  1101.  
  1102. #define FONTSIZE(n) { n##0000, 0 }
  1103.  
  1104. typedef struct tagFONTDESC
  1105. {
  1106.     UINT cbSizeofstruct;
  1107.     LPOLESTR lpstrName;
  1108.     CY cySize;
  1109.     SHORT sWeight;
  1110.     SHORT sCharset;
  1111.     BOOL fItalic;
  1112.     BOOL fUnderline;
  1113.     BOOL fStrikethrough;
  1114.  
  1115. } FONTDESC;
  1116.  
  1117. /////////////////////////////////////////////////////////////////////////////
  1118. // Picture attributes
  1119.  
  1120. #define PICTURE_SCALABLE        0x1l
  1121. #define PICTURE_TRANSPARENT     0x2l
  1122.  
  1123. /////////////////////////////////////////////////////////////////////////////
  1124. // IPicture interface
  1125.  
  1126. #undef  INTERFACE
  1127. #define INTERFACE IPicture
  1128.  
  1129. DECLARE_INTERFACE_(IPicture, IUnknown)
  1130. {
  1131.     // IUnknown methods
  1132.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1133.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1134.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1135.  
  1136.     // IPicture methods
  1137.     STDMETHOD(get_Handle)(THIS_ OLE_HANDLE FAR* phandle) PURE;
  1138.     STDMETHOD(get_hPal)(THIS_ OLE_HANDLE FAR* phpal) PURE;
  1139.     STDMETHOD(get_Type)(THIS_ short FAR* ptype) PURE;
  1140.     STDMETHOD(get_Width)(THIS_ OLE_XSIZE_HIMETRIC FAR* pwidth) PURE;
  1141.     STDMETHOD(get_Height)(THIS_ OLE_YSIZE_HIMETRIC FAR* pheight) PURE;
  1142.     STDMETHOD(Render)(THIS_ HDC hdc, long x, long y, long cx, long cy,
  1143.         OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
  1144.         OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
  1145.         LPCRECT lprcWBounds) PURE;
  1146.     STDMETHOD(set_hPal)(THIS_ OLE_HANDLE hpal) PURE;
  1147.     STDMETHOD(get_CurDC)(THIS_ HDC FAR * phdcOut) PURE;
  1148.     STDMETHOD(SelectPicture)(THIS_
  1149.         HDC hdcIn, HDC FAR * phdcOut, OLE_HANDLE FAR * phbmpOut) PURE;
  1150.     STDMETHOD(get_KeepOriginalFormat)(THIS_ BOOL * pfkeep) PURE;
  1151.     STDMETHOD(put_KeepOriginalFormat)(THIS_ BOOL fkeep) PURE;
  1152.     STDMETHOD(PictureChanged)(THIS) PURE;
  1153.     STDMETHOD(SaveAsFile)(THIS_ LPSTREAM lpstream, BOOL fSaveMemCopy,
  1154.         LONG FAR * lpcbSize) PURE;
  1155.     STDMETHOD(get_Attributes)(THIS_ DWORD FAR * lpdwAttr) PURE;
  1156.  
  1157. };
  1158.  
  1159. /////////////////////////////////////////////////////////////////////////////
  1160. // IPictureDisp interface
  1161.  
  1162. #undef  INTERFACE
  1163. #define INTERFACE IPictureDisp
  1164.  
  1165. DECLARE_INTERFACE_(IPictureDisp, IDispatch)
  1166. {
  1167.     // IUnknown methods
  1168.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1169.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1170.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1171.  
  1172.     // IDispatch methods
  1173.     STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  1174.     STDMETHOD(GetTypeInfo)(THIS_ UINT itinfo, LCID lcid,
  1175.         ITypeInfo FAR* FAR* pptinfo) PURE;
  1176.     STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, LPOLESTR FAR* rgszNames,
  1177.         UINT cNames, LCID lcid, DISPID FAR* rgdispid) PURE;
  1178.     STDMETHOD(Invoke)(THIS_ DISPID dispidMember, REFIID riid, LCID lcid,
  1179.         WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult,
  1180.         EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr) PURE;
  1181. };
  1182.  
  1183.  
  1184. /////////////////////////////////////////////////////////////////////////////
  1185. // PICTDESC structure
  1186.  
  1187. #define PICTYPE_UNINITIALIZED (-1)
  1188. #define PICTYPE_NONE        0
  1189. #define PICTYPE_BITMAP        1
  1190. #define PICTYPE_METAFILE    2
  1191. #define PICTYPE_ICON        3
  1192. #ifdef _WIN32
  1193. #define PICTYPE_ENHMETAFILE    4
  1194. #endif
  1195.  
  1196. typedef struct tagPICTDESC
  1197. {
  1198.     UINT cbSizeofstruct;
  1199.     UINT picType;
  1200.     union
  1201.     {
  1202.         struct
  1203.         {
  1204.             HBITMAP   hbitmap;        // Bitmap
  1205.             HPALETTE  hpal;           // Accompanying palette
  1206.         } bmp;
  1207.  
  1208.         struct
  1209.         {
  1210.             HMETAFILE hmeta;          // Metafile
  1211.             int       xExt;
  1212.             int       yExt;           // Extent
  1213.         } wmf;
  1214.  
  1215.         struct
  1216.         {
  1217.             HICON hicon;              // Icon
  1218.         } icon;
  1219.  
  1220. #ifdef _WIN32
  1221.         struct
  1222.         {
  1223.             HENHMETAFILE hemf;        // Enhanced Metafile
  1224.         } emf;
  1225. #endif
  1226.     }
  1227. #if defined(NONAMELESSUNION)
  1228.     u
  1229. #endif
  1230.     ;
  1231.  
  1232. } PICTDESC;
  1233.  
  1234.  
  1235. #ifdef _WIN32
  1236. #ifndef RC_INVOKED
  1237. #pragma pack()
  1238. #endif // not RC_INVOKED
  1239. #endif // _WIN32
  1240.  
  1241. #endif // not __MKTYPLIB__
  1242.  
  1243.  
  1244. /////////////////////////////////////////////////////////////////////////////
  1245. //  Standard dispatch ID constants
  1246.  
  1247. #define DISPID_AUTOSIZE                 (-500)
  1248. #define DISPID_BACKCOLOR                (-501)
  1249. #define DISPID_BACKSTYLE                (-502)
  1250. #define DISPID_BORDERCOLOR              (-503)
  1251. #define DISPID_BORDERSTYLE              (-504)
  1252. #define DISPID_BORDERWIDTH              (-505)
  1253. #define DISPID_DRAWMODE                 (-507)
  1254. #define DISPID_DRAWSTYLE                (-508)
  1255. #define DISPID_DRAWWIDTH                (-509)
  1256. #define DISPID_FILLCOLOR                (-510)
  1257. #define DISPID_FILLSTYLE                (-511)
  1258. #define DISPID_FONT                     (-512)
  1259. #define DISPID_FORECOLOR                (-513)
  1260. #define DISPID_ENABLED                  (-514)
  1261. #define DISPID_HWND                     (-515)
  1262. #define DISPID_TABSTOP                  (-516)
  1263. #define DISPID_TEXT                     (-517)
  1264. #define DISPID_CAPTION                  (-518)
  1265. #define DISPID_BORDERVISIBLE            (-519)
  1266. #define DISPID_APPEARANCE                (-520)
  1267.  
  1268. #define DISPID_REFRESH                  (-550)
  1269. #define DISPID_DOCLICK                  (-551)
  1270. #define DISPID_ABOUTBOX                 (-552)
  1271.  
  1272. #define DISPID_CLICK                    (-600)
  1273. #define DISPID_DBLCLICK                 (-601)
  1274. #define DISPID_KEYDOWN                  (-602)
  1275. #define DISPID_KEYPRESS                 (-603)
  1276. #define DISPID_KEYUP                    (-604)
  1277. #define DISPID_MOUSEDOWN                (-605)
  1278. #define DISPID_MOUSEMOVE                (-606)
  1279. #define DISPID_MOUSEUP                  (-607)
  1280. #define DISPID_ERROREVENT               (-608)
  1281.  
  1282. #define DISPID_AMBIENT_BACKCOLOR        (-701)
  1283. #define DISPID_AMBIENT_DISPLAYNAME      (-702)
  1284. #define DISPID_AMBIENT_FONT             (-703)
  1285. #define DISPID_AMBIENT_FORECOLOR        (-704)
  1286. #define DISPID_AMBIENT_LOCALEID         (-705)
  1287. #define DISPID_AMBIENT_MESSAGEREFLECT   (-706)
  1288. #define DISPID_AMBIENT_SCALEUNITS       (-707)
  1289. #define DISPID_AMBIENT_TEXTALIGN        (-708)
  1290. #define DISPID_AMBIENT_USERMODE         (-709)
  1291. #define DISPID_AMBIENT_UIDEAD           (-710)
  1292. #define DISPID_AMBIENT_SHOWGRABHANDLES  (-711)
  1293. #define DISPID_AMBIENT_SHOWHATCHING     (-712)
  1294. #define DISPID_AMBIENT_DISPLAYASDEFAULT (-713)
  1295. #define DISPID_AMBIENT_SUPPORTSMNEMONICS (-714)
  1296. #define DISPID_AMBIENT_AUTOCLIP         (-715)
  1297. #define DISPID_AMBIENT_APPEARANCE        (-716)
  1298.  
  1299.  
  1300. /////////////////////////////////////////////////////////////////////////////
  1301. // Dispatch ID constants for font and picture types
  1302.  
  1303. #define DISPID_FONT_NAME    0
  1304. #define DISPID_FONT_SIZE    2
  1305. #define DISPID_FONT_BOLD    3
  1306. #define DISPID_FONT_ITALIC  4
  1307. #define DISPID_FONT_UNDER   5
  1308. #define DISPID_FONT_STRIKE  6
  1309. #define DISPID_FONT_WEIGHT  7
  1310. #define DISPID_FONT_CHARSET 8
  1311.  
  1312. #define DISPID_PICT_HANDLE  0
  1313. #define DISPID_PICT_HPAL    2
  1314. #define DISPID_PICT_TYPE    3
  1315. #define DISPID_PICT_WIDTH   4
  1316. #define DISPID_PICT_HEIGHT  5
  1317. #define DISPID_PICT_RENDER  6
  1318.  
  1319.  
  1320. #ifdef __MKTYPLIB__
  1321.  
  1322. /////////////////////////////////////////////////////////////////////////////
  1323. // Names of modules containing type libraries for standard types
  1324.  
  1325. #ifdef _WIN32
  1326. #define STDOLE_TLB "stdole32.tlb"
  1327. #define STDTYPE_TLB "olepro32.dll"
  1328. #else
  1329. #define STDOLE_TLB "stdole.tlb"
  1330. #endif
  1331.  
  1332. #endif // __MKTYPLIB__
  1333.  
  1334. #endif // _OLECTL_H_
  1335.